package com.nulldev.util.web.HttpServer3.extensions.http2.compat;

import java.util.regex.Pattern;

public class HttpRequestPath {
	private String path;

	public HttpRequestPath(String path) {
		this.path = path;
	}

	public boolean willMoveToParentDirectory() {
		return path.contains("..");
	}

	public boolean matchesPattern(String pattern) {
		return Pattern.matches(pattern, path);
	}

//	public boolean matchesPattern(RequestMappingWrapper requestMapping) {
//		if (requestMapping.exact())
//			return path.equals(requestMapping.value());
//		return matchesPattern(requestMapping.getRegexPattern());
//	}

	public String get() {
		return path;
	}

	public String toString() {
		return path;
	}
}
